#pragma once


#ifdef __cplusplus
extern "C" {
#endif
#include "esp_wifi.h"
#include "lvgl.h"
#include "lv_port_disp.h"
#include "lv_port_indev.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"


#ifdef   VAR_PAGE_GLOBALS
#define  VAR_PAGE_EXT
#else
#define  VAR_PAGE_EXT  extern
#endif
typedef void (*lv_page_show)(void);
typedef void (*lv_page_quit)(void);

typedef struct page
{
    lv_obj_t* page;
    lv_page_show show;
    lv_page_quit quit;
};
typedef struct page * page_t;

extern lv_obj_t * ui_ssidPage;
extern lv_obj_t * ui_wifiPage;
extern lv_obj_t * ui_searchPage;
extern lv_obj_t * ui_mp3Page;
extern lv_obj_t * ui_scPage;
VAR_PAGE_EXT lv_group_t *group;

int push_page(lv_obj_t* page);
lv_obj_t* pop_page();
lv_obj_t* get_top_page();
void page_init();
void page_show_pre();
void show_smart_config_ok();
void show_smart_config_wait();
void show_smart_config_fail();

void lv_thread();



#ifdef __cplusplus
}
#endif